package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 轮播图表
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-07-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_carousel_map")
public class GuCarouselMap extends Model<GuCarouselMap> {

    private static final long serialVersionUID = 1L;

    /**
     * 轮播图id
     */

    @TableId(value = "cm_id", type = IdType.AUTO)
    private Integer cmId;

    /**
     * 轮播图标题
     */

    private String cmTitle;
    /**
     * 轮播图类型
     */
    @Value("cm_type")
    private Integer cmType;
    /**
     * 轮播图图片
     */
    private String cmCarouselMapImg;

    /**
     * 轮播图跳转路径
     */
    @TableField(exist = false)
    private String cmUrl;

    /**
     * 轮播图跳转路径类型
     */
    @TableField(exist = false)
    private Integer cmUrlType;

    /**
     * 轮播图排序
     */
    private Integer cmSort;

    /**
     * 轮播图可用1不可用0
     */
    private Boolean cmEnable;

    /**
     * 轮播图添加时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cmCreateTime;

    /**
     * 轮播图修改时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime cmUpdateTime;


    @Override
    protected Serializable pkVal() {
        return this.cmId;
    }

}
